<template>
  <div class="sign-count">
    <div class="sign-count-inner">
      <div class="sign-count-list" v-for="(item,index) in eliteList" :key="index">
        <div class="person-image"><img :src="item.photo_url"></div>
        <div class="person-name">{{item.realname}}</div>
      </div>
    </div>
  </div>
</template>

<script>

export default {
 data(){
   return{
    activityID:'',
    eliteList:[],
   }
 },
 onLoad(option) {
    this.activityID = option.id;
  },
  onShow(){
    this.reqActivityDetail(this.activityID);
  },
  //下拉刷新
  onPullDownRefresh () {
    this.reqActivityDetail(this.activityID);
  },
  methods:{
    //通过传递过来的参数获取活动数据
    async reqActivityDetail(id){
      var userToken = wx.getStorageSync('userToken');
      let params = { 
        activity_id: id,
        user_token: userToken 
      };
      let res = await this.$api.getActivityDtail(params);
      wx.stopPullDownRefresh()
      if(res.data.level == "success"){
        this.eliteList = res.data.data.join_user_list;
        console.log(this.eliteList)
      }else{
        wx.showToast({
          title: '获取内容失败',
          icon: 'none',
          duration: 1000
        })
      }
    },
  }
}
</script>

<style lang="scss" scoped>
  .sign-count{
    background-color: #f1f1f1;
    min-height: 100vh;
    .sign-count-inner{
      padding: 20rpx 20rpx 0;
      background-color: #fff;
      display: flex;
      flex-wrap: wrap;
      .sign-count-list{
        width: 140rpx;
        margin-right: 22rpx;
        margin-bottom: 20rpx;
        .person-image{
          width: 100%;
          height: 140rpx;
          border-radius: 50%;
          img{
            width: 100%;
            height: 100%;
            border-radius: 50%;
          }
        }
        .person-name{
          color: #666666;
          font-size: 26rpx;
          height: 40rpx;
          line-height: 40rpx;
          text-align: center;
        }
      }
    }
    
  }
</style>